import request from '@/utils/request'

// 列表（分页）
export function pageList(query) {
  return request({
    url: '/system/banner/pageList',
    method: 'get',
    loading: true,
    params: query
  })
}

// 新增
export function add(data) {
  return request({
    url: '/system/banner',
    method: 'post',
    loading: true,
    data: data
  })
}

// 修改
export function edit(data) {
  return request({
    url: '/system/banner',
    method: 'put',
    loading: true,
    data: data
  })
}

// 查询详情
export function getInfo(id) {
  return request({
    url: '/system/banner/' + id,
    method: 'get',
    loading: true
  })
}

// 修改状态
export function changeShowStatus(id, showStatus) {
  const data = {
    id,
    showStatus
  }
  return request({
    url: '/system/banner/changeShowStatus',
    method: 'put',
    loading: true,
    data: data
  })
}

// 删除
export function remove(id) {
  return request({
    url: '/system/banner/' + id,
    method: 'delete',
    loading: true
  })
}

